package com.inexas.cu.server;

import com.google.inject.*;
import com.google.inject.servlet.*;
import com.inexas.cu.guice.*;
import com.inexas.cu.server.pipe.*;

public class Bootstrap extends GuiceServletContextListener {
	private static Injector factory;

	@Override
	protected Injector getInjector() {
		factory = GuiceFactory.getInjector(	//
		        new ProductionServerSideModule(), //
		        new ServletModule() {
			        @Override
			        protected void configureServlets() {
				        serve("/cu/pipe").with(PipeServlet.class);
			        }
		        });

		return factory;
	}

	public static Injector getFactory() {
    	return factory;
    }

}
